package org.example.demo21.answer;

import lombok.extern.slf4j.Slf4j;

/**
 *
 * @author guocong
 * @since 2024/3/15 13:49
 */
@Slf4j
public class Fibonacci {

    public static void main(String[] args) {
        int cp = cp(30);
        System.out.println("\033[31m  " + cp + "  \033[0m");
        log.info("\033[31m  " + cp + "  \033[0m");
    }

    public static int cp(int n){
        if(n<=0){
            return 0;
        }
        else if(n==1||n==2){
            return 1;
        }
        else{
            return cp(n-1)+cp(n-2);
        }
    }
}
